<template>
	<view>
		<view class="ipt mt26">
			<u-input
				v-model="value"
				type="textarea"
				border
				placeholder="请输入您的反馈问题"
				:customStyle="{ fontSize: 28 + 'rpx' }"
			/>
		</view>
		<view class="button textc auto white fs32 fw600" @click="handerSubmit">确认提交</view>
	</view>
</template>

<script setup>
import { addFankui } from '@/utils/api.js';
import { onMounted, ref } from 'vue';
let value = ref('');
const handerSubmit = () => {
	if (!value.value) {
		return uni.showToast({
			title: '请输入你的问题',
			icon: 'none'
		});
	}
	addFankui({ content: value.value }).then(res => {
		console.log(res);
		if (res.code == 1) {
			uni.showToast({
				title: res.msg,
				icon: 'none'
			});
			setTimeout(() => {
				uni.switchTab({
					url: '/pages/my/my'
				});
			}, 1500);
		} else {
			return uni.showToast({
				title: res.msg,
				icon: 'none'
			});
		}
	});
};
onMounted(() => {
	let pageHead = document.getElementsByTagName('uni-page-head');
	pageHead[0].style.display = 'none';
});
</script>

<style lang="scss" scoped>
page {
	background-color: #f6f7fa;
}
.u-input {
	width: 690rpx;
	height: 492rpx;
	background: #ffffff;
	border-radius: 30rpx;
	margin: 0 auto;
	padding: 0 !important;
	padding-top: 10rpx !important;
	padding-left: 30rpx !important;
}
.button {
	width: 594rpx;
	height: 90rpx;
	line-height: 90rpx;
	background: linear-gradient(137deg, #f65249 0%, #e1251b 100%);
	border-radius: 15rpx;
	margin-top: 264rpx;
	letter-spacing: 4rpx;
}
</style>
